<template>
    <view class="good-item" @click.stop="$tools.go(`/pages/goods/index?id=${goods.id}`)">
        <view class="img-con">
            <image class="inner-img" width="100%" height="100%" mode="widthFix" :src="$imgUrl + goods.thumb" />
            <view class="sg-tag-list gmlist">
                <view class="sg-tag-item" v-for="(item, index) in goods.act_tag" :key="index">{{ item }}</view>
            </view>
        </view>
        <view class="detail">
            <view class="item-name text-limit-2">
                {{ goods.name }}
            </view>
            <view class="item-price">
                <text class="price mprice"> <text class="pi">￥</text> {{ goods.activity_price }}</text>
                <text class="price-old" v-if="goods.sell">¥{{ goods.sell }}</text>
            </view>
        </view>
    </view>
</template>
<script setup>
const props = defineProps({
    goods: {
        type: Object,
        default: {}
    }
})

</script>
<style scoped lang="scss">
.good-item {
    position: relative;
    width: 100%;

    .img-con {
        width: 100%;
        text-align: center;
        position: relative;

        .inner-img {
            width: 190rpx;
            height: 190rpx;
        }

        .sg-tag-list {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: nowrap;
            max-height: 38rpx;
            overflow: hidden;
            position: absolute;
            bottom: 0;
            left: 0;
        }

        .sg-tag-item {
            padding: 2rpx 8rpx;
            display: flex;
            align-items: center;
            justify-content: center;
            display: inline-block;
            font-size: 18rpx;
            background: #fff6f6;
            border: 1px solid #fff6f6;
            color: #f00;
            margin-right: 8rpx;
            border-radius: 4rpx;
        }
    }

    .detail {
        width: 100%;
        padding: 10rpx 8rpx 0;
    }

    .item-name {
        width: 100%;
        min-height: 68rpx;
        margin: 8rpx 0 0;
        text-align: center;
        box-sizing: border-box;
        color: #000;
        font-size: 24rpx;
    }

    .item-price {
        margin-top: 8rpx;
        display: flex;
        align-items: center;
        justify-content: center;

        .price {
            margin-right: 6rpx;
            display: inline-block;
            font-size: 28rpx;
            font-weight: bold;

            .pi {
                font-size: 22rpx;
                position: relative;
                left: 8rpx;
                top: -2rpx;
            }
        }



        .price-old {
            margin-left: 4rpx;
            color: #4f4f4f;
            text-decoration: line-through;
            font-size: 18rpx;
            font-weight: normal;
            position: relative;
        }
    }
}
</style>
